#ifndef _FACTORY_H
#define	_FACTORY_H

#include <iostream>

using namespace std;

enum PlatformType
{
    MotifPlatform,
    WindowsPlatform
};

class Widget
{
public:
    virtual void draw() = 0;
};

class MotifButton : public Widget
{
public:
    void draw() { cout << "MotifButton\n"; }
};

class MotifMenu : public Widget
{
public:
    void draw() { cout << "MotifMenu\n"; }
};

class WindowsButton : public Widget
{
public:
    void draw() { cout << "WindowsButton\n"; }
};

class WindowsMenu : public Widget
{
public:
    void draw() { cout << "WindowsMenu\n"; }
};

class Factory
{
public:
    static Factory* createFactory(PlatformType platform);
    virtual Widget* createButton() = 0;
    virtual Widget* createMenu() = 0;

private:
    static Factory *factory;
};

#endif	/* _FACTORY_H */

